package com.coldchain.message.push;

import com.coldchain.common.msg.ObjectRestResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/push")
public class PushAccountController {

    @Autowired
    private PushAccountService accountService;

    @GetMapping("/account")
    public Object getPushAccount(){
        return new ObjectRestResponse().data(accountService.getPushAccount());
    }

    @PostMapping("/edit")
    public Object edit(PushAccountService.JiguangPushAccount account){
        accountService.eidt(account);
        return new ObjectRestResponse<>().succeed();
    }
}
